/*****************************************************************************
 
 File:   OTKWorkspaceManager.java
 
 Date          Build     Author        Version    Comments
29-May-12    P-20-54    rkothari          $$1        Created

****************************************************************************/
package com.ptc.otkjavaexamples.ui;

import com.ptc.cipjava.jxthrowable;
import com.ptc.uifc.uifcInputPanel.InputPanel;
import com.ptc.uifc.uifcInputPanel.uifcInputPanel;
import com.ptc.uifc.uifcLabel.Label;
import com.ptc.uifc.uifcLabel.uifcLabel;
import com.ptc.uifc.uifcPushButton.PushButton;
import com.ptc.uifc.uifcPushButton.uifcPushButton;

public class OTKCacheManager
{
    /*
     * Set values into label (Server Location , Cache Space , Disk Space)
     * 
     * Add Action Listener for PushButtons "Clear" and "Cache Tools"
     * 
     * 
     */
    public OTKCacheManager()
    {
	try
	    {
		Label cacheLoc = uifcLabel.LabelFind(OTKServerRegistryDialog.OTK_SERVER_DIALOG, "location_label");
		cacheLoc.SetText("Location : //home//user//.wf//.cache2");
		
		InputPanel wsIp = uifcInputPanel.InputPanelFind(OTKServerRegistryDialog.OTK_SERVER_DIALOG, "ws_space_ip");
		wsIp.SetIntegerValue(400);
		
		InputPanel cacheIp = uifcInputPanel.InputPanelFind(OTKServerRegistryDialog.OTK_SERVER_DIALOG, "total_cache_ip");
		cacheIp.SetIntegerValue(12);
		
		InputPanel diskIP = uifcInputPanel.InputPanelFind(OTKServerRegistryDialog.OTK_SERVER_DIALOG, "disk_space_ip");
		diskIP.SetIntegerValue(13819);
		
		OTKCacheTools listener = new OTKCacheTools();
		PushButton clearPB = uifcPushButton.PushButtonFind(OTKServerRegistryDialog.OTK_SERVER_DIALOG, "cache_tools_pb");
		clearPB.AddActionListener(listener);
		
		PushButton cacheToolsPB = uifcPushButton.PushButtonFind(OTKServerRegistryDialog.OTK_SERVER_DIALOG, "clear_cache_pb");
		cacheToolsPB.AddActionListener(listener);
		
	    }
	catch (jxthrowable e)
	    {
		e.printStackTrace();
	    }
	
	
    }

}
